/**
 * 
 */
package controllers;

import client.gui.panels.EvaluationReportPanel;
import client.gui.panels.PanelIF;
import entities.Message;
import entities.MsgType;
import entities.ObjectType;

/**
 * @author Vodi
 * Evaluation Report Panel's cpntroller
 */
public class EvaluationReportController implements ControllerIF {

	/**
	 * the controlled panel
	 */
	private EvaluationReportPanel evaluationReport;
	
	/**
	 * reference of the hosting panel's controller
	 */
	private ViewTicketController hostController; 
	
	
	public EvaluationReportController(ControllerIF hostController) {
		this.hostController = (ViewTicketController) hostController;
	}
	
	/* (non-Javadoc)
	 * @see controllers.ControllerIF#getPanel()
	 */
	@Override
	public PanelIF getPanel() {
		return evaluationReport;
	}

	@Override
	public void setPanel(PanelIF panel) {
		this.evaluationReport = (EvaluationReportPanel) panel;
	}

	/* (non-Javadoc)
	 * @see controllers.ControllerIF#action()
	 */
	@Override
	public void action() {
		System.out.println("EvaluationReportController.action(): trying to send message to server, SET_EVALUATION_REPORT_REQUEST");
		Message message = new Message(MsgType.SET_EVALUATION_REPORT_REQUEST, ObjectType.EVALUATION_STAGE, evaluationReport.getEvaluationReportStage());
		hostController.sendMessage(message);
	}

	/* (non-Javadoc)
	 * @see controllers.ControllerIF#decipherMessage(entities.Message)
	 */
	@Override
	public void decipherMessage(Message message) {}

}
